package com.ruoyi.zxjd.common;

import java.util.List;

import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.zxjd.common.domain.CommonUserVO;
import com.ruoyi.zxjd.common.mapper.CommonMapper;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 公共Service业务层处理
 * 
 * @author lcc
 * @date 2021-01-21
 */
@Service
public class CommonServiceImpl implements ICommonService {
    @Autowired
    private CommonMapper commonMapper;

    /**
     * 查询有效用户数
     * 
     */
    @Override
    public int countActiveUser() {
        return commonMapper.countActiveUser();
    }

    /**
     * 查询有效用户数
     * 
     */
    @Override
    public List<CommonUserVO> listActiveUser(CommonUserVO userVO) {
        String[] deptIds = null;
        String[] roleIds = null;
        if(StringUtils.isNotNull(userVO)){
            deptIds = userVO.getDeptIds();
            roleIds = userVO.getRoleIds();
        }
        return commonMapper.listActiveUser(deptIds,roleIds);
    }
}
